import { GaRegExp, ruleInject, ruleInjectable } from "../../InjectionRule";
import { blankRemove } from "../../methods/blank-remove";
import { MakeListRule } from "../../methods/make-list";

@ruleInjectable()
export default class annotationRule extends GaRegExp {

	@ruleInject() private variableNameRule!: GaRegExp;

	@ruleInject() private calcRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			this.Supply("ANNOTATION"),
			"(", "@", blankRemove, "(", this.variableNameRule, ")", blankRemove, "(", "\\(", ...MakeListRule([this.calcRule]), "\\)", "|", this.Supply("EMPTY"), ")", blankRemove, ")*",
		]);
	}

}
